{extend name="base" /}
{block name="body"}
<style type="text/css" >
.layui-table th {
    padding: 9px 9px;
}
</style>

<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">提现管理</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form layui-form-pane" action="{:url('admin/extract/index')}" method="get">
                    <div class="layui-inline">
                        <label class="layui-form-label">关键词</label>
                        <div class="layui-input-inline">
                            <input type="text" name="keyword" value="{$keyword}" placeholder="请输入关键词" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">钱包类型</label>
                        <div class="layui-input-block">
                            <select name="wallet_type_id">
                                <option value="">请选择</option>
                                {foreach name="wallet_type" item="vo" key="k"}
                                <option value="{$k}"  {eq name="wallet_type_id" value="$k"}selected{/eq} >{$vo}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">处理类型</label>
                        <div class="layui-input-block">
                            <select name="status_type_id" id="status">
                                <option value="">请选择</option>
                                {foreach name="status_type" item="vo" key="k"}
                                <option value="{$k}"  {eq name="status_type_id" value="$k"}selected{/eq} >{$vo}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">开始时间</label>
                        <div class="layui-input-inline">
                            <input type="text" name="begin_time" value="{$begin_time}" class="layui-input datetime">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">结束时间</label>
                        <div class="layui-input-inline">
                            <input type="text" name="end_time" value="{$end_time}" class="layui-input datetime">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn">搜索</button>
                    </div>
                    <div class="layui-inline">
                        <span class="layui-btn" id="daochu">导出</span>
                    </div>
                    
                </form>
                <hr>
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 30px;">ID</th>
                        <th>会员</th>
                        <th>金额<span style="color:#e90d24;">({$extract.sum_num})</span></th>
                        <th>钱包类型</th>
                        <th>银行</th>
                        <th>账号</th>
                        <th>真实姓名</th>
                        <th>状态</th>
                        <th>时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach name="list" item="vo"}
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.user_name}</td>
                        <td>{$vo.num}</td>
                        <td>{$wallet_type[$vo.wallet_type]}</td>
                        <td>{$vo.bank_name}</td>
                        <td>{$vo.card_id}</td>
                        <td>{$vo.true_name}</td>
                        <td>{$status_type[$vo.status]}</td>
                        <td>{$vo.time|date_time}</td>
                        <td>
                            {if condition="$vo.status == 100"}
                                <a href="#" onclick="withdraw_repost(this,'{$vo.id}')" class="layui-btn layui-btn-normal layui-btn-mini">审核通过</a>
                                <a href="#" onclick="withdraw_refuse(this,'{$vo.id}')" class="layui-btn layui-btn-normal layui-btn-mini" style="background-color: red">拒绝</a>
                            {else/}
                                <a href="#" onclick="" class="layui-btn layui-btn-normal layui-btn-mini" style="background-color: gray">审核通过</a>
                                <a href="#" onclick="" class="layui-btn layui-btn-normal layui-btn-mini" style="background-color: gray">拒绝</a>
                            {/if}
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
                <!--分页-->
                {$list->render()}
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    /*审核*/
    function withdraw_repost(obj,id){

        layer.confirm('确认要审核通过吗？',function(index){
            $.post("{:url('admin/extract/edit')}",{id:id},function(e){

                layer.msg('已通过!',{icon:1,time:1000});
                location.reload();
            });
        });
    }

    /*拒绝*/
    function withdraw_refuse(obj,id){

        layer.confirm('确认要拒绝吗？',function(index){
            $.post("{:url('admin/extract/refuse')}",{id:id},function(e){

                layer.msg('已拒绝!',{icon:1,time:1000});
                location.reload();
            });
        });
    }

    $("#daochu").click(function(){
        var status = $('#status option:selected').val();
        var url = "{:url('admin/extract/daochu')}";
        if (status) {
            url = url+"?status="+status;
        }
        window.location.href = url;
    });
</script>
{/block}

